//
//  DemoViewController.swift
//  CopyWB
//
//  Created by imac on 2017/5/12.
//  Copyright © 2017年 iimac. All rights reserved.
//

import UIKit

class DemoViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    //监听方法
    func showNext(){
        let vc = DemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension DemoViewController{
    
    override func setupTableView() {
        super.setupTableView()
        //设置右侧控制器
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", fontSize: 16, target: self, action: #selector(showNext))
    }
}
